<template>
	<view>
		<view v-for="(item, yaofang_index) in yaofang.list" :key="yaofang_index" class="order" @click="goto_yaofang_info(item.id)">
			<view class="con_top">
				<view class="username">
					{{item.user.name}}
				</view>
				<view class="line">
					<view class="label">联系方式</view>
					<view class="value">{{item.user.tel}}</view>
				</view>
				<view class="line">
					<view class="label">订单号</view>
					<view class="value">{{item.user.tel}}</view>
				</view>
				<view class="line">
					<view class="label">物流单号</view>
					<view class="value">{{item.user.tel}}</view>
				</view>
				<view class="line">
					<view class="label">收货地址</view>
					<view class="value">{{item.user.tel}}</view>
				</view>
			</view>
			<view class="line2">
				<view class="post_btn">
					<image class="post_icon" src="@/static/image/post_icon.png"></image>
					<view>寄出</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { yaoshi_get_yaofang_list } from '@/util/api/api.js';
	
	export default {
		data() {
			return {
				url:{
					get_yaofang_list_url:'/index.php/html5/yaoshi/get_yaofang_list'
				},
				yaofang:{
					list:[],
					curpage:0,
					listnum:20,
					total:0
				},
			}
		},
		onLoad() {
			this.get_yaofang_list()
		},
		methods: {
			goto_yaofang_page(id=0){
				uni.navigateTo({
					url: '../yaoshi/yaofang?id='+id
				});
			},
			get_yaofang_list(curpage=0,listnum=0){
				let that = this
				let data = {
					curpage:curpage,
					listnum:listnum
				}
				
				yaoshi_get_yaofang_list(data).then((res)=>{
					if (res.code==200) {
						that.yaofang.list.push(...res.data.datalist)
						that.yaofang.curpage = res.data.pages
						that.yaofang.total = res.data.total
					} else{
						// that.showToast(res.message)
					}
				})
			},
			goto_yaofang_info(id){
				uni.navigateTo({
					url: '../yaoshi/yaofang?id='+id
				});
			},
		}
	}
</script>

<style scoped>
page{
	background-color: #F5F5F5;
}

.order{
	width: 690rpx;
	margin: 30rpx;
	background: #FFFFFF;
	border-radius: 8px;
	
}

.con_top{
	padding: 30rpx;
}

.username{
	font-size: 36rpx;
	font-weight: bold;
	color: #333333;
	line-height: 77rpx;
}
.line{
	display: flex;
}
.label{
	width: 5em;
	font-size: 28rpx;
	font-weight: 500;
	color: #B3B3B3;
	line-height: 42rpx;
}
.value{
	width: 286rpx;
	height: 22rpx;
	font-size: 28rpx;
	font-family: PingFang SC;
	font-weight: 500;
	color: #333333;
	line-height: 42rpx;
}
.post_icon{
	width: 28rpx;
	height: 28rpx;
}
.post_btn{
	width: 100rpx;
	height: 30rpx;
	display: flex;
	justify-content: space-between;
	font-size: 28rpx;
	font-family: PingFang SC;
	font-weight: 500;
	color: #808080;
	line-height: 30rpx;
	margin: 25rpx auto;
	
}
.line2{
	height: 86rpx;
	border-top: 2rpx solid #f5f5f5;
}
</style>